package atm;
import javax.swing.*;
import java.awt.*;


public class LoginPanel extends JPanel {
    private ImageIcon loginImg = new ImageIcon("images/buttonLand.jpg");
    private JLabel accountLabel = new JLabel("账号：");
    private JLabel pwdLabel = new JLabel("密码：");
    private JTextField accountField = new JTextField();
    private JPasswordField pwdField = new JPasswordField();
    private JButton loginBtn = new JButton(loginImg);

    private Font font = new Font("黑体",Font.BOLD,30);
    public LoginPanel(){
        this.setLayout(null);

        accountLabel.setBounds(300,200,120,50);
        accountLabel.setFont(font);

        accountField.setBounds(400,200,250,50);
        accountField.setFont(font);

        pwdLabel.setBounds(300,260,120,50);
        pwdLabel.setFont(font);

        pwdField.setBounds(400,260,250,50);
        pwdField.setFont(font);

        loginBtn.setBounds(350,320,140,50);
        this.add(accountLabel);
        this.add(accountField);
        this.add(pwdLabel);
        this.add(pwdField);
        this.add(loginBtn);
        // 设置当前面板的背景为透明
        this.setOpaque(false);
    }
}
